﻿using System;


namespace DiscoveryLogic.DataServices.DataSources
{
    public static class UserProfileManager
    {
        private static UserProfile userProfile;

        public static UserProfile getUserProfile()
        {
            // If the user profile object already exists, return it
            // Otherwise, create it
            if (userProfile == null)
            {
                // Call webservice to generate user profile obj
                // For now, just create it
                userProfile = new UserProfile();
            }

            return userProfile;
        }
    }

    public class UserProfile
    {
        #region Private Variables

            string firstName;
            string lastName;
            DateTime dateOfBirth;
            double annualIncome;
            int socialSecurityNumber;
            string gender;
            int riskTolerance;
            double contributionAmount;

        #endregion

        #region Constructors

            public UserProfile()
            {
                SetSampleData();
            }

        #endregion

        #region Helper Methods

            private void SetSampleData()
            {
                firstName = "John";
                lastName = "Smith";
                dateOfBirth = DateTime.Today.AddYears(-40);
                annualIncome = 30000;
                socialSecurityNumber = 1234567;
                gender = "Male";
                riskTolerance = 5;
                contributionAmount = 10;
            }

        #endregion

        #region Public Properties

            public string FirstName
            {
                get { return firstName; }
                set { firstName = value; }
            }

            public string LastName
            {
                get { return lastName; }
                set { lastName = value; }
            }

            public DateTime DateOfBirth
            {
                get { return dateOfBirth; }
                set { dateOfBirth = value; }
            }

            public double AnnualIncome
            {
                get { return annualIncome; }
                set { annualIncome = value; }
            }

            public int SocialSecurityNumber
            {
                get { return socialSecurityNumber; }
                set { socialSecurityNumber = value; }
            }

            public string Gender
            {
                get { return gender; }
                set { gender = value; }
            }

            public int RiskTolerance
            {
                get { return riskTolerance; }
                set { riskTolerance = value; }
            }

            public double ContributionAmount
            {
                get { return contributionAmount; }
                set { contributionAmount = value; }
            }

        #endregion
    }
}
